# %%
from tensorflow import keras
import numpy as np
from PIL import Image
import cv2
import tensorflow as tf
print(tf.__version__)
physical_devices = tf.config.list_physical_devices('GPU')
tf.config.experimental.set_memory_growth(physical_devices[0], True)
print(physical_devices)

# %%
auto_encoder_model = keras.models.load_model('auto_encoder.h5')
auto_encoder_model.summary()

# %%
pic2vec_model = keras.Sequential(layers=auto_encoder_model.layers[:24])
pic2vec_model.compile()
pic2vec_model.summary()
pic2vec_model.save('pic2vec.h5')

# %%
